package com.example;

import org.springframework.util.StringUtils;

import java.util.HashMap;
import java.util.Map;

public class StringTest {

    public static void main(String[] args) {
        String ss = "nmc_case_$provcode_abc";
        Map<String,String> params = new HashMap<>();
        params.put("prov_id","111");
        String s = StringTest.replaceProv(ss, params);

        System.out.println(s);
    }

    public static String replaceProv(String str, Map singleProvCode) {
        return !StringUtils.isEmpty(str) ? str.replace("$provcode", (String) singleProvCode.get("prov_id")) : "";
    }
}
